#pragma once
#include <bitset>
#include <map>
//using std::bitset;
using namespace std;

class MarchingCubeTable
{
public:
	MarchingCubeTable(void);
	~MarchingCubeTable(void);
	//void initTMap(void);
	//void initRotate(void);

public:
	static MarchingCubeTable* getInstance();
	//bitset<8>* getTriangles(bitset<8>);
	bitset<15>* getTriangles(bitset<15>);
	//bitset<8> rot(bitset<8>, int*);
	//bitset<8> revert(bitset<8>, int*);
	void constructTeTriangles(int &i, int, int, int, int, bitset<15>);
	void setTrianglesEnd(int i);

private:
	static MarchingCubeTable* mct;            //MarchingCuble Table point
	//map<int, int* > tmap;            //Map used to find triangles
	//static int rotate[48][8];								      //Array used to rotate point
	//bitset<8> triangles[12];					      //Triangles to return
	bitset<15> triangles[144];						//Triangles to return
	//static int  mapTable[15][12];
};
